<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset='utf-8' />
    <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
    <title>地下模式</title>
    <!--引入第三方的jquery脚本库-->
    <script include="jquery" src="./static/libs/include-lib-local.js"></script>
    <!-- Cesium脚本库文件引用 -->
    <script src="./static/libs/include-cesium-local.js"></script>
    <!--当前示例页面样式表引用-->
    <link rel="stylesheet" href="./static/demo/cesium/style.css" />
    <script>
        'use strict';
        //定义三维视图的主要类
        var webGlobe;
        var sceneManager;
        //地图初始化函数
        function init() {
            //构造三维视图类（视图容器div的id，三维视图设置参数）
            webGlobe = new Cesium.WebSceneControl('GlobeView', {});
            //初始化视图功能管理类
            sceneManager = new CesiumZondy.Manager.SceneManager({
                viewer: webGlobe.viewer
            });
        }

        function undergroundOne() {
            //设置地下模式
            webGlobe.viewer.scene.globe.undergroundMode = true;
            //大气显示关闭
            webGlobe.viewer.scene.skyAtmosphere.show = false;
            //透明度设置
            webGlobe.viewer.scene.globe.transparent = 0.3;
            //背景色设置
            webGlobe.viewer.scene.baseColor = new Cesium.Color(255 / 255, 255 / 255, 255 / 255, 1);
            webGlobe.viewer.scene.globe.imageryLayers.get(0).alpha = 1;
        }

        function undergroundTwo() {
            //设置地下模式
            webGlobe.viewer.scene.globe.undergroundMode = true;

            //大气显示关闭
            webGlobe.viewer.scene.skyAtmosphere.show = false;
            //地面大气效果关闭
            webGlobe.viewer.scene.skyAtmosphere.showGroundAtmosphere = false;
            //透明度设置
            webGlobe.viewer.scene.enableTransparent = true;
            //透明度设置
            webGlobe.viewer.scene.globe.transparent = 1;
            //背景颜色设置
            webGlobe.viewer.scene.baseColor = new Cesium.Color(255 / 255, 255 / 255, 255 / 255, 0.0001);
            webGlobe.viewer.scene.globe.imageryLayers.get(0).alpha = 0;
        }

        function goDefault() {
            //关闭地下模式
            webGlobe.viewer.scene.globe.undergroundMode = false;
            //大气显示开启
            webGlobe.viewer.scene.skyAtmosphere.show = true;
            //地面大气效果开启
            webGlobe.viewer.scene.skyAtmosphere.showGroundAtmosphere = true;
            //透明度设置
            webGlobe.viewer.scene.enableTransparent = false;
            //背景色设置
            webGlobe.viewer.scene.baseColor = new Cesium.Color(255 / 255, 255 / 255, 255 / 255, 1);
            webGlobe.viewer.scene.globe.imageryLayers.get(0).alpha = 1;
            //复位
            sceneManager.goHome();
        }
    </script>
</head>

<body onload="init()">
    <div id="GlobeView">
        <div class="message">
            <button id="default" onclick="goDefault()">默认模式</button>
            <button id="undergroundOne" onclick="undergroundOne()">地下模式一</button>
            <button id="undergroundTwo" onclick="undergroundTwo()">地下模式二</button>
        </div>
    </div>
</body>

</html>